fix(surveys): honor choice option shuffling - #772
Merged
Merged
Conversation
Apply the existing shuffleOptions flag in the shared Compose choice UI. Shuffle original indices, keep Other last and preserve the display order through selection, text edits and saved-state restoration. Preserve the configured choice list and submit the selected label or open-choice text. Add parameterized order tests and eight mounted interaction cases covering single/multiple selection, open choice, disabled shuffling, restoration, response values and advancing to a question with a different choice count. Run the Compose debug suite in CI and record its test dependency locks. Verification: make testSurveyUI (25 tests); Compose build and local publish; formatting and CodeScene safeguard passed. Full build/release verification is recorded in the PR description.
3 tasks
Contributor
Prompt To Fix All With AI### Issue 1
posthog-android-surveys-compose/src/testDebug/java/com/posthog/android/surveys/compose/internal/ui/SurveyShuffleInteractionTest.kt:27-29
**Unclear Boolean parameter names**
The parameters `multiple`, `open`, and `shuffle` do not clearly communicate that they control multiple-choice mode, open-choice support, and option shuffling. This violates the repository directive to use variable names that clearly indicate their purpose. Rename them to descriptive names such as `isMultipleChoice`, `hasOpenChoice`, and `shouldShuffleOptions`; this repository requirement must be satisfied before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(surveys): honor choice option shuffl..." | Re-trigger Greptile |
turnipdabeets
approved these changes
Sep 15, 2026
Use descriptive names for multiple-choice, open-choice and shuffle flags in the parameterized UI tests, addressing the review comment on #772. Validation: make testSurveyUI passes all 25 tests; make format succeeds. CodeScene pre-commit safeguard reports no issues.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Honor the existing
shuffleOptionsflag in Android Compose surveys, moving toward survey feature parity across all PostHog SDKs. Matches web behavior for single- and multiple-choice questions:The change lives in the shared choice renderer. No public API changes. Separate from partial responses/resume (#768) and auto-submit (#769); iOS counterpart: PostHog/posthog-ios#811.
💚 How did you test it?
make testSurveyUI: 25 tests passed, including 8 parameterized order tests and 8 mounted interaction cases. Covers both choice types, enabled/disabled shuffle, Other text, saved-state restoration, exact responses and advancing to a question with fewer choices.CI=true make compile, Compose debug/release build,make checkRelease, formatting and the CodeScene safeguard passed.The additional build configuration and lockfile entries enable the Compose interaction tests in CI; runtime dependencies are unchanged.
📝 Checklist
pnpm changeset.🤖 Agent context
Autonomy: Human-driven (agent-assisted). Codex implemented and tested this through CLI tools. Human review is required.